package com.xg.util.excel;

import java.lang.reflect.Field;

public class ReflectionTemplateUtils {

    public static int getColumnIndexByField(Class<?> clazz, String fieldName) {
        Field[] fields = clazz.getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getName().equals(fieldName)) {
                return i;
            }
        }
        return -1; // 没有找到字段，返回 -1
    }
}
